package com.bestcem.xm.award.grpc.service.param.requestaward;

import com.bestcem.xm.award.enums.DeliverSceneEnum;
import com.bestcem.xm.award.enums.DeliverSourceEnum;
import com.bestcem.xm.common.core.constant.RegTypes;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 投放信息参数
 *
 * @author jie.yao <jie.yao@idiaoyan.com>
 * @version v1.0
 * @date 2021/6/29 14:18
 */
@ToString
@NoArgsConstructor
@Getter
@Setter
public class DeliverParam {

    /**
     * 投放id
     */
    @NotBlank(message = ErrorMessage.DELIVER_ID_NULL_ERROR)
    @Pattern(regexp = RegTypes.OBJECT_ID, message = ErrorMessage.DELIVER_ID_FORMAT_ERROR)
    private String id;

    /**
     * 投放来源 {@link DeliverSourceEnum}
     */
    private Integer source;

    /**
     * 编号
     */
    private String code;

    /**
     * 组织编号
     */
    private String orgCode;

    /**
     * 场景 {@link DeliverSceneEnum}
     */
    private Integer scene;

    /**
     * (可选) 奖励id
     */
    private String awardId;

    /**
     * (可选) 成员id
     */
    private String memberId;

    public static class ErrorMessage {
        public static final String DELIVER_ID_NULL_ERROR = "投放id不能为空";
        public static final String DELIVER_ID_FORMAT_ERROR = "投放id格式错误";
        private ErrorMessage () {}
    }
}
